package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.EmpContractSalaryMapper;
import com.ruoyi.manage.domain.EmpContractSalary;
import com.ruoyi.manage.service.IEmpContractSalaryService;

/**
 * 合同工资明细Service业务层处理
 * 
 * @author cf
 * @date 2025-06-04
 */
@Service
public class EmpContractSalaryServiceImpl implements IEmpContractSalaryService 
{
    @Autowired
    private EmpContractSalaryMapper empContractSalaryMapper;

    /**
     * 查询合同工资明细
     * 
     * @param salaryId 合同工资明细主键
     * @return 合同工资明细
     */
    @Override
    public EmpContractSalary selectEmpContractSalaryBySalaryId(Long salaryId)
    {
        return empContractSalaryMapper.selectEmpContractSalaryBySalaryId(salaryId);
    }

    /**
     * 查询合同工资明细列表
     * 
     * @param empContractSalary 合同工资明细
     * @return 合同工资明细
     */
    @Override
    public List<EmpContractSalary> selectEmpContractSalaryList(EmpContractSalary empContractSalary)
    {
        return empContractSalaryMapper.selectEmpContractSalaryList(empContractSalary);
    }

    /**
     * 新增合同工资明细
     * 
     * @param empContractSalary 合同工资明细
     * @return 结果
     */
    @Override
    public int insertEmpContractSalary(EmpContractSalary empContractSalary)
    {
        empContractSalary.setCreateTime(DateUtils.getNowDate());
        return empContractSalaryMapper.insertEmpContractSalary(empContractSalary);
    }

    /**
     * 修改合同工资明细
     * 
     * @param empContractSalary 合同工资明细
     * @return 结果
     */
    @Override
    public int updateEmpContractSalary(EmpContractSalary empContractSalary)
    {
        return empContractSalaryMapper.updateEmpContractSalary(empContractSalary);
    }

    /**
     * 批量删除合同工资明细
     * 
     * @param salaryIds 需要删除的合同工资明细主键
     * @return 结果
     */
    @Override
    public int deleteEmpContractSalaryBySalaryIds(Long[] salaryIds)
    {
        return empContractSalaryMapper.deleteEmpContractSalaryBySalaryIds(salaryIds);
    }

    /**
     * 删除合同工资明细信息
     * 
     * @param salaryId 合同工资明细主键
     * @return 结果
     */
    @Override
    public int deleteEmpContractSalaryBySalaryId(Long salaryId)
    {
        return empContractSalaryMapper.deleteEmpContractSalaryBySalaryId(salaryId);
    }
}
